﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Comissoes.Models.NotasFiscaisModel>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <%= ViewData["scripts"] %>
    <script type="text/javascript" src="../../Scripts/cadastros/enderecos.js"></script>
    <!-- Custom JS -->
    <script type="text/javascript" src="../../Scripts/digitacoes/NotasFiscais.js"></script>
</head>
<body>
    <div class="cabecalho ui-state-highlight">
        <span class="icoedt" />
        <span class="txt">
            <%= Html.Encode("Digitação de Nota Fiscal") %>
        </span>
    </div>
    <form id="MainForm" action="#">
        <%= Html.Hidden("ENPS_LOJA", Model.nf.VENDAS == null || Model.nf.VENDAS.ENDERECO_LOJA == null ? "" : Model.nf.VENDAS.ENDERECO_LOJA.ID_ENPS.ToString())%>
        <%= Html.Hidden("ENPS_CLI", Model.nf.VENDAS == null || Model.nf.VENDAS.ENDERECO_CLIENTE == null ? "" : Model.nf.VENDAS.ENDERECO_CLIENTE.ID_ENPS.ToString())%>
        <%= Html.Hidden("ENPS_TRAN", Model.nf.VENDAS == null || Model.nf.VENDAS.ENDERECO_TRANSPORTADOR == null ? "" : Model.nf.VENDAS.ENDERECO_TRANSPORTADOR.ID_ENPS.ToString())%>
        <%= Html.Hidden("ENPS_RET", Model.nf.VENDAS == null || Model.nf.VENDAS.ENDERECO_RETIRADA == null ? "" : Model.nf.VENDAS.ENDERECO_RETIRADA.ID_ENPS.ToString())%>
        <%= Html.Hidden("ENPS_ENTR", Model.nf.VENDAS == null || Model.nf.VENDAS.ENDERECO_ENTREGA == null ? "" : Model.nf.VENDAS.ENDERECO_ENTREGA.ID_ENPS.ToString())%>

        <%= Html.Hidden("ID_RGTR", Model.nf.VENDAS.LOJAS == null ? "" : Model.nf.VENDAS.LOJAS.REGIMES_TRIBUTARIOS.ID_RGTR.ToString()) %>
        <%= Html.Hidden("ID_NF", Model.nf.ID_NF) %>
        <%= Html.Hidden("ID_ITVD") %>
        <%= Html.Hidden("ID_ITVD", Model.nf.STATUS_NF) %>
        <div class="pagina">
            <fieldset class="container transparent">
                <%= Html.Button("Gravar", "diskcommand", "Gravar", "Gravar", false) %>
                <%= Html.Button("Validar", "checkcommand", "Validar", "Validar", false) %>
                <%= Html.Button("Transmitir", "signalcommand", "Transmitir", "Transmitir", false) %>
                <%= Html.Button("Danfe", "printcommand", "Danfe", "Danfe", false) %>
                <%= Html.Button("Listar", "listcommand", "Listar", "Listar", false) %>
            </fieldset>
            <fieldset class="container field900 border">
                <fieldset class="container transparent">
                    <% Html.RenderPartial("Cabecalho", Model); %>
                </fieldset>
                <div class="tabscontainer">
                    <ul>
                        <li><a href="#Itens"><span>Produtos e Serviços</span></a></li>
                        <li><a href="#Transporte"><span>Transporte</span></a></li>
                        <li><a href="#Pagamentos"><span>Pagamentos</span></a></li>
                        <li><a href="#Complemento"><span>Complemento</span></a></li>
                        <li><a href="#Totais"><span>Totais</span></a></li>
                    </ul>
                    <div id="Itens">
                        <fieldset class="container transparent nomargin">
                            <% Html.RenderPartial("Itens", Model); %>
                        </fieldset>
                        <div class="tabsprodutos">
                            <ul>
                                <li><a href="#ItensICMS"><span>Icms</span></a></li>
                                <li><a href="#ItensIPI"><span>Ipi</span></a></li>
                                <li><a href="#ItensPIS"><span>Pis</span></a></li>
                                <li><a href="#ItensCOFINS"><span>Cofins</span></a></li>
                                <li><a href="#ItensISSQN"><span>Issqn</span></a></li>
                                <li><a href="#ItensImportacao"><span>Importação</span></a></li>
                                <li><a href="#ItensInfo"><span>Info</span></a></li>
                                <li><a href="#Veiculo"><span>Veículo</span></a></li>
                                <li><a href="#Medicamento"><span>Medicamento</span></a></li>
                                <li><a href="#Armamento"><span>Armamento</span></a></li>
                                <li><a href="#Combustivel"><span>Combustível</span></a></li>
                            </ul>
                            <div id="ItensICMS">
                                <fieldset class="container transparent">
		                            <% Html.RenderPartial("ItensICMS", Model); %>
                                </fieldset>
	                        </div>
                            <div id="ItensIPI">
                                <fieldset class="container transparent nomargin nopadding">
		                            <% Html.RenderPartial("ItensIPI", Model); %>
                                </fieldset>
	                        </div>
                            <div id="ItensPIS">
                                <fieldset class="container transparent">
		                            <% Html.RenderPartial("ItensPIS", Model); %>
                                </fieldset>
	                        </div>
                            <div id="ItensCOFINS">
                                <fieldset class="container transparent">
		                            <% Html.RenderPartial("ItensCOFINS", Model); %>
                                </fieldset>
	                        </div>
                            <div id="ItensISSQN">
                                <fieldset class="container transparent">
		                            <% Html.RenderPartial("ItensISSQN", Model); %>
                                </fieldset>
	                        </div>
                            <div id="ItensImportacao">
                                <fieldset class="container transparent">
		                            <% Html.RenderPartial("ItensImportacao", Model); %>
                                </fieldset>
	                        </div>
                            <div id="ItensInfo">
		                        <fieldset class="container transparent nopadding">
                                    <%= Html.LabelInput(Html.TextArea("INFOADI_ITVD", null, new { rows = "6" }), "area860") %>
                                </fieldset>
	                        </div>
                            <div id="Veiculo">
                                <fieldset class="container transparent">
		                            <% Html.RenderPartial("Veiculo", Model); %>
                                </fieldset>
	                        </div>
                            <div id="Medicamento">
                                <fieldset class="container transparent">
		                            <% Html.RenderPartial("Medicamento", Model); %>
                                </fieldset>
	                        </div>
                            <div id="Armamento">
                                <fieldset class="container transparent">
		                            <% Html.RenderPartial("Armamento", Model); %>
                                </fieldset>
	                        </div>
                            <div id="Combustivel">
                                <fieldset class="container transparent">
		                            <% Html.RenderPartial("Combustivel", Model); %>
                                </fieldset>
	                        </div>
                        </div>

                        <fieldset class="container transparent nomargin nopadding">
                            <label class="space clear"></label>
                            <label class="clear floatright insidebutton">
                                <button class="addcommand iinsert" type="button" onclick="ItenUpdate()">Inserir</button>
                            </label>
                            <label class="floatright insidebutton">
                                <button class="pencilcommand iupdate" type="button" disabled="disabled" onclick="ItenUpdate()">Alterar</button>
                            </label>
                            <label class="floatright insidebutton">
                                <button class="closecommand icancel" type="button" disabled="disabled" onclick="ItensClear()">Cancelar</button>
                            </label>
                        </fieldset>

                        <fieldset class="container transparent nomargin nopadding">
                            <table id="table"></table>
                            <div id="pager"></div>
                        </fieldset>
                    </div>
                    <div id="Transporte">
                        <fieldset class="container transparent">
                            <% Html.RenderPartial("Transporte", Model); %>
                        </fieldset>
                    </div>
                    <div id="Pagamentos">
                        <fieldset class="container transparent nomargin nopadding">
                            <% Html.RenderPartial("CondicaoPagamento", Model); %>
                        </fieldset>
                    </div>
                    <div id="Complemento">
                        <fieldset class="container transparent nomargin">
                            <% Html.RenderPartial("Complemento", Model); %>
                        </fieldset>
                    </div>
                    <div id="Totais">
                        <fieldset class="container transparent">
                            <% Html.RenderPartial("Totais", Model); %>
                        </fieldset>
                    </div>                        
                </fieldset>
            </div>
        </div>
    </form>
</body>
</html>
